{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Stock's Data Feature Importance (Continuous)"
      ],
      "metadata": {
        "nteract": {
          "transient": {
            "deleting": false
          }
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import pandas as pd\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "import yfinance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:17.674Z",
          "iopub.execute_input": "2020-06-28T18:20:17.679Z",
          "shell.execute_reply": "2020-06-28T18:20:18.798Z",
          "iopub.status.idle": "2020-06-28T18:20:18.777Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2020-01-01'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)\n",
        "\n",
        "# View Columns\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 completed\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 2,
          "data": {
            "text/plain": [
              "            Adj Close  Close  High   Low  Open    Volume\n",
              "Date                                                    \n",
              "2014-01-02       3.95   3.95  3.98  3.84  3.85  20548400\n",
              "2014-01-03       4.00   4.00  4.00  3.88  3.98  22887200\n",
              "2014-01-06       4.13   4.13  4.18  3.99  4.01  42398300\n",
              "2014-01-07       4.18   4.18  4.25  4.11  4.19  42932100\n",
              "2014-01-08       4.18   4.18  4.26  4.14  4.23  30678700"
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Close</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Open</th>\n",
              "      <th>Volume</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-02</th>\n",
              "      <td>3.95</td>\n",
              "      <td>3.95</td>\n",
              "      <td>3.98</td>\n",
              "      <td>3.84</td>\n",
              "      <td>3.85</td>\n",
              "      <td>20548400</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>3.98</td>\n",
              "      <td>22887200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.01</td>\n",
              "      <td>42398300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.19</td>\n",
              "      <td>42932100</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.23</td>\n",
              "      <td>30678700</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 2,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:18.784Z",
          "iopub.execute_input": "2020-06-28T18:20:18.789Z",
          "iopub.status.idle": "2020-06-28T18:20:20.131Z",
          "shell.execute_reply": "2020-06-28T18:20:20.164Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],1,0)\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,0)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,0)\n",
        "dataset['Returns'] = dataset['Adj Close'].pct_change()\n",
        "dataset = dataset.dropna()"
      ],
      "outputs": [],
      "execution_count": 3,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.139Z",
          "iopub.execute_input": "2020-06-28T18:20:20.144Z",
          "iopub.status.idle": "2020-06-28T18:20:20.173Z",
          "shell.execute_reply": "2020-06-28T18:20:20.168Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 4,
          "data": {
            "text/plain": [
              "            Adj Close  Close  High   Low  Open    Volume  Increase_Decrease  \\\n",
              "Date                                                                          \n",
              "2014-01-03       4.00   4.00  4.00  3.88  3.98  22887200                  1   \n",
              "2014-01-06       4.13   4.13  4.18  3.99  4.01  42398300                  1   \n",
              "2014-01-07       4.18   4.18  4.25  4.11  4.19  42932100                  0   \n",
              "2014-01-08       4.18   4.18  4.26  4.14  4.23  30678700                  0   \n",
              "2014-01-09       4.09   4.09  4.23  4.05  4.20  30667600                  0   \n",
              "\n",
              "            Buy_Sell_on_Open  Buy_Sell   Returns  \n",
              "Date                                              \n",
              "2014-01-03                 1         1  0.012658  \n",
              "2014-01-06                 1         1  0.032500  \n",
              "2014-01-07                 1         0  0.012106  \n",
              "2014-01-08                 0         0  0.000000  \n",
              "2014-01-09                 0         1 -0.021531  "
            ],
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Adj Close</th>\n",
              "      <th>Close</th>\n",
              "      <th>High</th>\n",
              "      <th>Low</th>\n",
              "      <th>Open</th>\n",
              "      <th>Volume</th>\n",
              "      <th>Increase_Decrease</th>\n",
              "      <th>Buy_Sell_on_Open</th>\n",
              "      <th>Buy_Sell</th>\n",
              "      <th>Returns</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>Date</th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "      <th></th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2014-01-03</th>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>4.00</td>\n",
              "      <td>3.88</td>\n",
              "      <td>3.98</td>\n",
              "      <td>22887200</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.012658</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-06</th>\n",
              "      <td>4.13</td>\n",
              "      <td>4.13</td>\n",
              "      <td>4.18</td>\n",
              "      <td>3.99</td>\n",
              "      <td>4.01</td>\n",
              "      <td>42398300</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>1</td>\n",
              "      <td>0.032500</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-07</th>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.25</td>\n",
              "      <td>4.11</td>\n",
              "      <td>4.19</td>\n",
              "      <td>42932100</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0.012106</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-08</th>\n",
              "      <td>4.18</td>\n",
              "      <td>4.18</td>\n",
              "      <td>4.26</td>\n",
              "      <td>4.14</td>\n",
              "      <td>4.23</td>\n",
              "      <td>30678700</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2014-01-09</th>\n",
              "      <td>4.09</td>\n",
              "      <td>4.09</td>\n",
              "      <td>4.23</td>\n",
              "      <td>4.05</td>\n",
              "      <td>4.20</td>\n",
              "      <td>30667600</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>-0.021531</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 4,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.180Z",
          "iopub.execute_input": "2020-06-28T18:20:20.186Z",
          "iopub.status.idle": "2020-06-28T18:20:20.198Z",
          "shell.execute_reply": "2020-06-28T18:20:20.986Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.shape"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 5,
          "data": {
            "text/plain": [
              "(1509, 10)"
            ]
          },
          "metadata": {}
        }
      ],
      "execution_count": 5,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.207Z",
          "iopub.execute_input": "2020-06-28T18:20:20.211Z",
          "iopub.status.idle": "2020-06-28T18:20:20.222Z",
          "shell.execute_reply": "2020-06-28T18:20:20.989Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = dataset[['Open', 'High', 'Low', 'Volume', 'Increase_Decrease','Buy_Sell_on_Open', 'Buy_Sell', 'Returns']]\n",
        "y = dataset['Adj Close']"
      ],
      "outputs": [],
      "execution_count": 6,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.228Z",
          "iopub.execute_input": "2020-06-28T18:20:20.233Z",
          "iopub.status.idle": "2020-06-28T18:20:20.241Z",
          "shell.execute_reply": "2020-06-28T18:20:20.991Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from sklearn.ensemble import RandomForestRegressor\n",
        "\n",
        "# Create decision tree classifer object\n",
        "clf = RandomForestRegressor(random_state=0, n_jobs=-1)\n",
        "\n",
        "# Train model\n",
        "model = clf.fit(X, y)"
      ],
      "outputs": [],
      "execution_count": 7,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.248Z",
          "iopub.execute_input": "2020-06-28T18:20:20.253Z",
          "iopub.status.idle": "2020-06-28T18:20:20.969Z",
          "shell.execute_reply": "2020-06-28T18:20:20.993Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Calculate feature importances\n",
        "importances = model.feature_importances_"
      ],
      "outputs": [],
      "execution_count": 8,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:20.976Z",
          "iopub.execute_input": "2020-06-28T18:20:20.979Z",
          "iopub.status.idle": "2020-06-28T18:20:21.079Z",
          "shell.execute_reply": "2020-06-28T18:20:21.086Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Sort feature importances in descending order\n",
        "indices = np.argsort(importances)[::-1]\n",
        "\n",
        "# Rearrange feature names so they match the sorted feature importances\n",
        "names = [dataset.columns[i] for i in indices]\n",
        "\n",
        "# Create plot\n",
        "plt.figure()\n",
        "\n",
        "# Create plot title\n",
        "plt.title(\"Feature Importance\")\n",
        "\n",
        "# Add bars\n",
        "plt.bar(range(X.shape[1]), importances[indices])\n",
        "\n",
        "# Add feature names as x-axis labels\n",
        "plt.xticks(range(X.shape[1]), names, rotation=90)\n",
        "\n",
        "# Show plot\n",
        "plt.show()"
      ],
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ],
            "image/png": [
              "iVBORw0KGgoAAAANSUhEUgAAAXcAAAFdCAYAAAD49y2uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwO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nvRzjyZ5FJhSdRGxUtbrD3aA8vMNKqynZ6XNPXqWpItYPjnYWsBU4NzqKopR8IikF9u+BkDS3wOPVVxTT0qzTPSsckrYfksoVu9ZWFU9sfIk7Qycw/I53DcHDinXyI1hSLhHI0jaFLjH+YHueZLWBp5PMUL11ow0Hpm0uUfPkbSrpMsl/VDSTpJuBG4E/iZpn6rri5W2M7A9xfqpMzp1d42h5co9ek45+vRDFKv0nAbsa/t35cRh38/qS71L0lnA1hQLoC8tdzuDmIYv4R49R9J1tncsP7/F9gtajmVpvR4m6RZgaprXVl6aZaIXPdXyeXtPioRCb7sReG7VRTRBukJGL9pB0oMUN9zWLz+n3F6vurJiFGwK3Czp98AT/TszMG34Eu7Rc2yPqbqGWGU+XnUBTZE294iIBsqVe0RUTtJDdL5fIoreMs9czSX1vFy5R0Q0UHrLREQ0UMI9IqKBEu4REQ2UcI+IaKCEe0REA/1/UbA9NY7GYI8AAAAASUVORK5CYII=\n"
            ]
          },
          "metadata": {
            "needs_background": "light"
          }
        }
      ],
      "execution_count": 9,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2020-06-28T18:20:21.099Z",
          "iopub.execute_input": "2020-06-28T18:20:21.104Z",
          "iopub.status.idle": "2020-06-28T18:20:21.267Z",
          "shell.execute_reply": "2020-06-28T18:20:21.275Z"
        }
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "file_extension": ".py",
      "name": "python",
      "codemirror_mode": {
        "version": 3,
        "name": "ipython"
      },
      "mimetype": "text/x-python",
      "nbconvert_exporter": "python",
      "version": "3.5.5",
      "pygments_lexer": "ipython3"
    },
    "kernelspec": {
      "argv": [
        "C:\\Users\\Tin Hang\\Anaconda3\\envs\\py35\\python.exe",
        "-m",
        "ipykernel_launcher",
        "-f",
        "{connection_file}"
      ],
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "nteract": {
      "version": "0.23.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}